import {Entity, Column, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn} from 'typeorm';

import {ApiProperty} from "@nestjs/swagger";

@Entity({name:'address'})
export class AddressEntity{

    @PrimaryGeneratedColumn()
    @ApiProperty({description: '主键ID'})
    id: number

    @Column()
    @ApiProperty({description: '地址编号'})
    code: string

    @Column()
    @ApiProperty({description: '地址名称'})
    name: string

    @Column()
    @ApiProperty({description: '父级地址编号'})
    pcode: string

    @Column()
    @ApiProperty({description: '地址级别'})
    level: number

    @CreateDateColumn()
    @ApiProperty({description: '创建时间'})
    createdTime: Date

    @UpdateDateColumn()
    @ApiProperty({description: '更新时间'})
    updatedTime: Date

}